package com.example;
import java.util.Scanner;

public class Day2Euqa {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.printf("Enter a b c :");
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        double c = sc.nextDouble();
        double x1, x2;
        double delta = b * b - 4 * a * c;
        if (a == 0 && b == 0 && c == 0) {
            System.out.println("The Equation has infinite solutions");
            return;
        }
        if (a == 0 && b == 0 && c != 0) {
            System.out.println("The Equation has no solution");
            return;
        }
        if(delta == 0){
            x1 = -b/(2*a);
            x2 = -b/(2*a);
            System.out.println("The Equation has one root: " + x1);
        }
        if(delta < 0){
            System.out.println("The Equation has no real roots");
        }
        if(delta > 0){
            x1 = (-b+Math.pow(delta,0.5))/(2*a);
            x2 = (-b-Math.pow(delta,0.5))/(2*a);
            System.out.println("The Equation has two roots: " + x1 +"and" + x2);
        }
    }
}
